home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / ums / listclient3_1.lha / UMSInitStem.rexx < prev   
OS/2 REXX Batch file  |  1994-08-06  |  5KB  |  166 lines

  1. /* ------------------------------------------------------------------------
  2. :Program.   UMSInitStem.rexx
  3. :Contents.  constant definitions and initialisations for ums.library
  4. :Author.    Martin Horneffer
  5. :History.   v1.0 [mh]  26-Sep-93
  6. :History.   v1.1 [hG]  22-Jan-94 added default parameter parsing,
  7. :History.                        incl. of RexxDosSupport.library etc.
  8. :Hsitory.   v1.2 [hG]  11-Jul-94 clear RC after GetVar()
  9. :History.   v1.3 [hG]  18-ul-94  uses rexxdossupport.library 2.2
  10. :Version.   $VER: UMSInit 1.3 (18.7.94)
  11. :Copyright. Freely Distributable
  12. :Language.  ARexx
  13. ------------------------------------------------------------------------ */
  14.  
  15. FALSE = 0
  16. TRUE  = 1
  17.  
  18. /* enumeration of fields in an UMS-message */
  19. UMSCODE.             =  ""
  20. UMSCODE_MsgText      =  0
  21. UMSCODE_FromName     =  1
  22. UMSCODE_FromAddr     =  2
  23. UMSCODE_ToName       =  3
  24. UMSCODE_ToAddr       =  4
  25. UMSCODE_MsgID        =  5
  26. UMSCODE_CreationDate =  6
  27. UMSCODE_ReceiveDate  =  7
  28. UMSCODE_RefID        =  8
  29. UMSCODE_Group        =  9
  30. UMSCODE_Subject      = 10
  31. UMSCODE_Attributes   = 11
  32. UMSCODE_Comments     = 12
  33. UMSCODE_Organization = 13
  34. UMSCODE_Distribution = 14
  35. UMSCODE_Folder       = 15
  36. UMSCODE_FidoID       = 16
  37. UMSCODE_MausID       = 17
  38. UMSCODE_ReplyGroup   = 18
  39. UMSCODE_ReplyName    = 19
  40. UMSCODE_ReplyAddr    = 20
  41. UMSCODE_FidoText     = 32
  42. UMSCODE_ErrorText    = 33
  43. UMSCODE_Newsreader   = 34
  44.  
  45. UMSNUMFIELDS = 128
  46.  
  47. /* user status-bits */
  48.  
  49. UMSUSTAT.            =  ""
  50. UMSUSTAT.Archive     =  4 /* msg should be archived, don't delete */
  51. UMSUSTAT.Junk        =  5 /* negative selection, inheritance suggested */
  52. UMSUSTAT.PostPoned   =  6 /* to be read again, (but not now) */
  53. UMSUSTAT.Selected    =  7 /* positive selection, inheritance suggested */
  54. UMSUSTAT.Old         =  8 /* user has already read this Message */
  55. UMSUSTAT.Read        = Old
  56. UMSUSTAT.WriteAccess =  9 /* user may change or delete this message */
  57. UMSUSTAT.ReadAccess  = 10 /* user may read this message */
  58. UMSUSTAT.ViewAccess  = 11 /* user may read the header of this message */
  59. UMSUSTAT.Owner       = 12 /* user 'owns' (wrote) this message */
  60.  
  61. UMSUFLAGS_Protected = '00001E00'x /* WriteAccess, ReadAccess, ViewAccess, Owner */
  62.  
  63. /* global status-bits */
  64.  
  65. UMSGSTAT.         = ""
  66. UMSGSTAT.Deleted  = 0 /* msg is really deleted */
  67. UMSGSTAT.Expired  = 1 /* msg has expired and may be deleted */
  68. UMSGSTAT.Exported = 2 /* msg has been exported */
  69. UMSGSTAT.Orphan   = 3 /* msg could not be exported */
  70. UMSGSTAT.Link     = 4 /* within a ring of linked msgs */
  71. UMSGSTAT.HardLink = 5 /* link is hardLink */
  72.  
  73. UMSGFLAGS_Protected = '0000003D'x /* Deleted, Exported, Orphan, Link, HardLink */
  74.  
  75. /* Errors */
  76.  
  77. UMSERR.        = ""
  78. UMSERR.ok      = 0
  79. UMSERR.unknown = 1
  80.  
  81. UMSERR.codeMissing   = 100
  82. UMSERR.forbiddenCode = 101
  83. UMSERR.noWriteAccess = 102
  84. UMSERR.noReader      = 103
  85. UMSERR.noExporter    = 104
  86. UMSERR.badLink       = 105
  87. UMSERR.noWork        = 106
  88. UMSERR.noSysop       = 107
  89. UMSERR.badChange     = 108
  90.  
  91. UMSERR.dupe         = 200
  92. UMSERR.noReadAccess = 201
  93. UMSERR.noViewAccess = 202
  94. UMSERR.msgCorrupted = 203
  95. UMSERR.noHdrSpace   = 204
  96. UMSERR.noSuchMsg    = 205
  97. UMSERR.badName      = 206
  98. UMSERR.badTag       = 207
  99. UMSERR.missingTag   = 208
  100. UMSERR.noSuchUser   = 209
  101. UMSERR.notFound     = 210
  102. UMSERR.autoBounce   = 211
  103. UMSERR.msgDeleted   = 212
  104. UMSERR.noNetAccess  = 213
  105. UMSERR.badPattern   = 214
  106. UMSERR.badVarname   = 215
  107. UMSERR.fsFull       = 216
  108. UMSERR.noMsgMem     = 217
  109. UMSERR.missingIndex = 218
  110.  
  111. UMSERR.serverTerminated = 300
  112. UMSERR.cantWrite        = 301
  113. UMSERR.cantRead         = 302
  114. UMSERR.wrongMsgPtr      = 303
  115. UMSERR.serverNotFree    = 304
  116. UMSERR.idCountProb      = 305
  117. UMSERR.noLogin          = 306
  118. UMSERR.wrongServer      = 307
  119. UMSERR.noMem            = 308
  120.  
  121. /*** Startup ***/
  122.  
  123. options results
  124.  
  125. RC = 0
  126.  
  127. signal on BREAK_C
  128. signal on BREAK_D
  129. signal on BREAK_E
  130. signal on BREAK_F
  131. signal on ERROR
  132. signal on HALT
  133. signal on IOERR
  134. signal on SYNTAX
  135.  
  136. /*** Open ums.library ***/
  137. /* result is ignored since AddLib() does not check whether the lib
  138.  * exists but only whether the name is already in the list
  139.  */
  140. call addlib('ums.library', 0, -210, 8)
  141. call addlib('rexxdossupport.library', 0, -30, 2)
  142.  
  143. /* get default values, parse arguments */
  144.  
  145. if symbol("server") ~= "VAR" then server = GetVar('UMSServer')
  146. if symbol("name") ~= "VAR" then name = GetVar('username')
  147. if (rc = 0) & (symbol("password") ~= "VAR") then password = GetVar('UMS/passwd/'name)
  148. RC = 0 /* don't care about missing ENV-Variables */
  149.  
  150. parse arg arguments
  151.  
  152. if strip(arguments) = '?' then do
  153.   address  command 'echo noline "' ArgsTemplate ': "'
  154.   pull arguments
  155. end; else nop
  156. if ~ ReadArgs(arguments,ArgsTemplate) then do
  157.   say Fault(RC,ProgramName)
  158.   exit 10
  159. end; else nop
  160.  
  161. drop arguments
  162.  
  163. /* Login is not done here to give the the chance to overwrite
  164.  * the arguments/env-vars during test phase of skripts.
  165.  */
  166.